#pragma once

#include "Common.h"
#include "JoystickState.h"

#define JOYSTICKMANAGER_JOYSTICK_MAX	1

// TODO: Add support for setting threshold values.
class JoystickManager
{
private:
	JoystickManager();
public:
	~JoystickManager();
public:
	static JoystickManager*	GetInstance();
public:
	void					Update();
public:
	float					GetAxis(int joystick, int axis) const;
	float					GetAxisChange(int joystick, int axis) const;
	bool					IsButtonDown(int joystick, int button) const;
	bool					IsButtonUp(int joystick, int button) const;
	bool					IsButtonPressed(int joystick, int button) const;
	bool					IsButtonReleased(int joystick, int button) const;
private:
	static JoystickManager*	m_pInstance;
private:
	JoystickState			m_oPreviousStates[JOYSTICKMANAGER_JOYSTICK_MAX];
	JoystickState			m_oCurrentStates[JOYSTICKMANAGER_JOYSTICK_MAX];
};
